package com.zzyl.mapper;

import com.aliyun.iot20180120.models.RegisterDeviceRequest;
import com.zzyl.dto.DeviceDto;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.entity.Device;
import com.zzyl.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DeviceMapper {

    //查询设备名称是否重复
    int countDeviceDuplicate(@Param("deviceName") String deviceName);

    //新增设备信息
    void insertDevice(Device device);

    //查询设备列表
    List<DeviceVo> selectDevicePage(DevicePageQueryDto pageQueryDto);

    //查询设备信息
    DeviceVo selectDeviceDetail(@Param("iotId") String iotId);

    //更新设备信息
    void UpdateDevice(Device device);

    //删除设备信息
    void deleteDeviceByIotId(@Param("iotId") String iotId);

    //查询该老人/位置是否绑定该设备
    Boolean countByBindingLocationANDProductKey(@Param("bindingLocation") Long bindingLocation,
                                                @Param("productKey") String productKey);
}
